import java.util.Scanner;

public class demo1 {
    public static int func(int b, int c) {
        int temp = 0;
        while (c != 0) {
            temp = b % c;
            b = c;
            c = temp;
        }
        return b;
    }
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        while (scan.hasNext()) {
            int n = scan.nextInt();
            int a = scan.nextInt();
            int[] nums = new int[n];
            for (int i = 0; i < n; i++) {
                nums[i] = scan.nextInt();
            }
            int ret = a;
            for (int i = 0; i < n; i++) {
                if (nums[i] <= ret) {
                    ret += nums[i];
                } else {
                    ret += func(nums[i], ret);
                }
            }
            System.out.println(ret);
        }
    }
}
